local sansi = fk.CreateSkill{
    name = "lingling__sansi"
}
Fk:loadTranslationTable{
    ["lingling__sansi"] = "三思",
    [":lingling__sansi"] = "出牌阶段限三次，你可以重铸一张黑色牌。",
}

sansi:addEffect("active",{
    max_phase_use_time = 3,
    can_use = function (self, player)
        return self:withinTimesLimit(player, Player.HistoryPhase)
    end,
    card_num = 1,
    card_filter = function (self, player, to_select, selected, selected_targets)
        return #selected == 0 and Fk:getCardById(to_select).color == Card.Black
    end,
    target_num = 0,
    target_filter = Util.FalseFunc,
    times = function (self, player)
        return player.phase == Player.Play and (3 - player:usedSkillTimes(sansi.name, Player.HistoryPhase)) or 0
    end,
    on_use = function (self, room, effect)
        room:recastCard(effect.cards, effect.from, sansi.name)
    end,
})

return sansi